package prac;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class HuoGuo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        List<Integer> times = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            int x = scanner.nextInt();
            int y = scanner.nextInt();
            times.add(x + y);
        }

        Collections.sort(times);

        int count = 0;
        int prev = -m; // 初始化为足够小，确保第一个时间可以选中

        for (int t : times) {
            if (t >= prev + m) {
                count++;
                prev = t;
            }
        }

        System.out.println(count);
    }
}
